<!-- html -->
<template>
  <h2 class="h2">自定义hooks</h2>
  <span class="span2">num：{{ num }}</span>
  <button class="button1" @click="changeNum">修改num</button>
  <br>
  <button class="button1" @click="getDog">获取一只狗</button>
  <br>
  <img class="img1" v-for="item in dogList" :src="item">
</template>

<!-- js或ts -->
<script lang="ts">
export default {
  name: 'hooksTest1'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
import useChangeNum from '@/assets/hooks/useChangeNum'
import useGetDog from '@/assets/hooks/useGetDog'
//数据
let { num, changeNum } = useChangeNum()
let { dogList, getDog } = useGetDog()
</script>

<!-- 样式 -->
<style scoped></style>@/assets/hooks/useChangeNum@/assets/hooks/useGetDog